<template>
	<view class="page-fade-in" :style="{opacity: pageOpc}">
		<template v-if="pageOpc">
			<web-view :src="allUrl"  class="webView"></web-view>
		</template>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				pageOpc:0,
				allUrl:'',
			}
		},
		onReady() {
			setTimeout(() => {
				this.pageOpc = 1
			}, 100)
		},
		onLoad() {
			this.getPdfUrl()
		},
		methods:{
			// 获取协议地址
			getPdfUrl(){
				this.$request.post(this.$api.getPdfUrl, {
					storeId:uni.getStorageSync('store_id'),
				}, {
					isJava: true
				}).then(res => {
					if(res.code==200){
						let {
							data = {}
						} = res;
						this.allUrl='https://static.mo-yu.vip/oss/pdf/index.html?pdfPath='+data.pdfPath
					}
				})
			},
		},
	}
</script>

<style lang="scss" scoped>
	.webView{
		width:100%;
		height: 100vh;
	}
</style>